package com.gary.controller;

import com.gary.entity.User;
import com.gary.mapper.IUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author pengrui
 * @date 2020/11/26 - 16:47
 */
@RestController
public class UserController {

    @Autowired
    private IUserMapper iUserMapper;

    @GetMapping("/userAll")
    public List<User> queryAll() {
        return iUserMapper.queryAll();
    }

    @GetMapping("/updateUser")
    public User updateUser(User user) {
        iUserMapper.updateUser(user);
        return user;
    }
}
